From: Stefan Monnier Date: Sat, 14 Feb 2009 21:41:26 +0000 (+0000) Subject: (with-buffer-prepared-for-jit-lock): Swap the `let' and X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~1771 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=2eeafa7b5ab7b0b6a595ae287fc187eb25cca35b;p=emacs.git (with-buffer-prepared-for-jit-lock): Swap the `let' and the `with-buffer-unmodified' to avoid useless `readlink' calls. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ee9a5750680..eb7887cd27a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-02-14 Stefan Monnier + + * jit-lock.el (with-buffer-prepared-for-jit-lock): Swap the `let' and + the `with-buffer-unmodified' to avoid useless `readlink' calls. + 2009-02-14 Roland Winkler * textmodes/bibtex.el (bibtex-global-key-alist) @@ -18,8 +23,8 @@ around forms that refer to translation-table-for-input. * international/quail.el (quail-input-string-to-events) - (quail-store-decode-map-key, quail-char-equal-p): Use - `with-no-warnings' around forms that refer to + (quail-store-decode-map-key, quail-char-equal-p): + Use `with-no-warnings' around forms that refer to translation-table-for-input. * simple.el (quoted-insert, zap-to-char): Use `with-no-warnings' diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index 384771e4f25..786d2b16c48 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el @@ -45,15 +45,17 @@ "Execute BODY in current buffer, overriding several variables. Preserves the `buffer-modified-p' state of the current buffer." (declare (debug t)) - `(with-buffer-unmodified - (let ((buffer-undo-list t) - (inhibit-read-only t) - (inhibit-point-motion-hooks t) - (inhibit-modification-hooks t) - deactivate-mark - buffer-file-name - buffer-file-truename) - ,@body)))) + `(let ((buffer-undo-list t) + (inhibit-read-only t) + (inhibit-point-motion-hooks t) + (inhibit-modification-hooks t) + deactivate-mark + buffer-file-name + buffer-file-truename) + ;; Do reset the modification status from within the let, since + ;; otherwise set-buffer-modified-p may try to unlock the file. + (with-buffer-unmodified + ,@body))))